//
// Created by Abstergo on 2024/6/14.
//

#ifndef TBS_CPP_ITREATORINL_CUH
#define TBS_CPP_ITREATORINL_CUH

template<typename T>
template<typename V>
CONST V *Iterator<T>::source_t() const {
  return source();
}

template<typename T>
bool Iterator<T>::operator!=(const Iterator<T> &other) const {
  return !this->equals(other);
}

template<typename T>
bool Iterator<T>::equals(const Iterator<T> &other) const {

  return source() == other.source() && index() == other.index();
}

template<typename T>
Iterator<T> &Iterator<T>::operator++() {
  if (has_next()) {
	return next();
  } else {
	throw tbs::base_error("no more element for this iterator");
  }
}

template<typename T>
T &Iterator<T>::operator*() {
  return value();
}

#endif //TBS_CPP_ITREATORINL_CUH
